<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人空间</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background: linear-gradient(135deg, #f5f7fa 0%, #e4e7f1 100%);
            min-height: 100vh;
            color: #333;
            padding: 20px;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
        }

        /* 上层导航栏 */
        .top-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 25px;
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            border-radius: 15px;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
            margin-bottom: 30px;
            color: white;
        }

        .back-button {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .back-button:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateX(-3px);
        }

        .back-button i {
            font-size: 24px;
        }

        .page-title {
            font-size: 28px;
            font-weight: 600;
            letter-spacing: 1px;
        }

        .username {
            font-size: 20px;
            font-weight: 500;
            padding: 8px 20px;
            background: rgba(255, 255, 255, 0.15);
            border-radius: 25px;
        }

        /* 内容区域 */
        .content-section {
            display: flex;
            flex-direction: column;
            gap: 30px;
        }

        /* 信息卡片样式 */
        .info-card {
            background: white;
            border-radius: 18px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
            overflow: hidden;
            display: flex;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .info-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
        }

        .card-title-section {
            background: linear-gradient(to right, #6a11cb, #2575fc);
            width: 180px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            color: white;
            writing-mode: vertical-lr;
            text-orientation: mixed;
            font-size: 24px;
            font-weight: 600;
            letter-spacing: 3px;
        }

        .card-content {
            flex: 1;
            padding: 30px;
            display: flex;
            flex-direction: column;
        }

        .info-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 25px;
            margin-bottom: 30px;
        }

        .info-item {
            display: flex;
            flex-direction: column;
            padding: 15px;
            background: #f9fafc;
            border-radius: 12px;
            border-left: 4px solid #6a11cb;
        }

        .info-label {
            font-size: 14px;
            color: #6c757d;
            margin-bottom: 5px;
        }

        .info-value {
            font-size: 18px;
            font-weight: 600;
            color: #2c3e50;
        }

        .button-group {
            display: flex;
            gap: 15px;
            margin-top: auto;
            justify-content: flex-end;
        }

        .action-button {
            padding: 14px 28px;
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .action-button i {
            font-size: 18px;
        }

        .edit-btn {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            color: white;
        }

        .edit-btn:hover {
            background: linear-gradient(135deg, #3a9dfc 0%, #00d9e6 100%);
            box-shadow: 0 5px 15px rgba(0, 242, 254, 0.3);
        }

        .password-btn {
            background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
            color: white;
        }

        .password-btn:hover {
            background: linear-gradient(135deg, #ff7b81 0%, #f8b9a9 100%);
            box-shadow: 0 5px 15px rgba(255, 154, 158, 0.3);
        }

        .recharge-btn {
            background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
            color: white;
        }

        .recharge-btn:hover {
            background: linear-gradient(135deg, #2ed368 0%, #15e8ca 100%);
            box-shadow: 0 5px 15px rgba(67, 233, 123, 0.3);
        }

        .history-btn {
            background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
            color: white;
        }

        .history-btn:hover {
            background: linear-gradient(135deg, #ff5252 0%, #ff8f8f 100%);
            box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
        }

        /* 金额卡片特殊样式 */
        .balance-card .card-title-section {
            background: linear-gradient(to right, #43e97b, #38f9d7);
        }

        .balance-value {
            font-size: 42px;
            font-weight: 700;
            text-align: center;
            margin: 20px 0;
            color: #2c3e50;
            background: linear-gradient(135deg, #43e97b, #38f9d7);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 2px 10px rgba(67, 233, 123, 0.15);
        }

        .currency {
            font-size: 24px;
            margin-right: 5px;
            vertical-align: super;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .info-grid {
                grid-template-columns: 1fr;
            }

            .card-title-section {
                width: 120px;
                font-size: 20px;
            }

            .button-group {
                flex-direction: column;
            }
        }
    </style>
</head>
<body>
<div class="container">
    <!-- 上层导航栏 -->
    <div class="top-bar">
        <!-- 返回按钮 -->
        <button class="back-button" onclick="location.href='/clients/clientmain'">
            <i class="fas fa-arrow-left"></i>
        </button>

        <!-- 页面标题 -->
        <div class="page-title">个人空间</div>

        <!-- 用户名 -->
        <div class="username">
            <!-- 数据接口：后端需提供 user.username -->
            <span th:text="${user != null} ? ${user.username} : '未登录用户'"></span>
        </div>
    </div>

    <!-- 下层内容区域 -->
    <div class="content-section">
        <!-- 个人信息卡片 -->
        <div class="info-card">
            <div class="card-title-section">个人信息</div>

            <div class="card-content">
                <div class="info-grid">
                    <div class="info-item">
                        <div class="info-label">用户ID</div>
                        <div class="info-value">
                            <span th:text="${user != null} ? ${user.userId} : 'N/A'"></span>
                        </div>
                    </div>
                    <div class="info-item">
                        <div class="info-label">用户名</div>
                        <div class="info-value">
                            <span th:text="${user != null} ? ${user.username} : '未登录用户'"></span>
                        </div>
                    </div>
                    <div class="info-item">
                        <div class="info-label">手机号</div>
                        <div class="info-value">
                            <span th:text="${user != null} ? ${user.phone} : '未设置'"></span>
                        </div>
                    </div>
                    <div class="info-item">
                        <div class="info-label">邮箱</div>
                        <div class="info-value">
                            <span th:text="${user != null} ? ${user.email} : '未设置'"></span>
                        </div>
                    </div>
                    <div class="info-item">
                        <div class="info-label">角色身份</div>
                        <div class="info-value">
                            <span th:text="${user != null} ? ${user.role} : '普通用户'"></span>
                        </div>
                    </div>
                </div>
                <!-- 操作按钮 -->
                <div class="button-group">
                    <button class="action-button edit-btn" onclick="location.href='/clients/clientuserinfo'">
                        <i class="fas fa-user-edit"></i> 修改个人信息
                    </button>
                    <button class="action-button password-btn" onclick="location.href='/clients/clientuserpassword'">
                        <i class="fas fa-lock"></i> 修改账号密码
                    </button>
                </div>
            </div>
        </div>

        <!-- 金额卡片 -->
        <div class="info-card balance-card">
            <div class="card-title-section">金额</div>
            <div class="card-content">
                <!-- 余额显示 -->
                <div class="balance-value">
                    <span class="currency">¥</span>
                    <!-- 数据接口：后端需提供 user.balance -->
                    <span th:text="${user != null} ? ${user.clientbalance} : '0.00'"></span>
                </div>
                <!-- 操作按钮 -->
                <div class="button-group">
                    <!-- 充值按钮 -->
                    <button class="action-button recharge-btn" onclick="location.href='/clients/clientrecharge'">
                        <i class="fas fa-coins"></i> 充值
                    </button>
                    <!-- 查看消费记录按钮 -->
                    <button class="action-button history-btn" onclick="location.href='/clients/clientpayhistory'">
                        <i class="fas fa-history"></i> 查看消费记录
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>